home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / eoshift.z / eoshift
Encoding:
Text File  |  2002-10-03  |  5.8 KB  |  131 lines

  1. EOSHIFT(3I)                                           Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      EEOOSSHHIIFFTT - Performs an end-off shift on an array expression
  6.  
  7. SSYYNNOOPPSSIISS
  8.      EEOOSSHHIIFFTT (([AARRRRAAYY==]_a_r_r_a_y,, [SSHHIIFFTT==]_s_h_i_f_t [,,[BBOOUUNNDDAARRYY==]_b_o_u_n_d_a_r_y]
  9.      [,,[DDIIMM==]_d_i_m]))
  10.  
  11. IIMMPPLLEEMMEENNTTAATTIIOONN
  12.      UNICOS, UNICOS/mk, IRIX systems
  13.  
  14.      CF90, MIPSpro 7 Fortran 90
  15.  
  16. SSTTAANNDDAARRDDSS
  17.      Fortran
  18.  
  19. DDEESSCCRRIIPPTTIIOONN
  20.      The EEOOSSHHIIFFTT intrinsic function performs an end-off shift on an array
  21.      expression of rank one, or it performs end-off shifts on all the
  22.      complete rank one sections along a given array expression of rank two
  23.      or greater.  Elements are shifted off at one end of a section and
  24.      copies of a boundary value are shifted in at the other end.  Different
  25.      sections can have different boundary values and can be shifted by
  26.      different amounts and in different directions; positive for left
  27.      shifts, negative for right shifts.
  28.  
  29.      EEOOSSHHIIFFTT accepts the following arguments:
  30.  
  31.      _a_r_r_a_y     May be of any type.  It must not be scalar.
  32.  
  33.      _s_h_i_f_t     Must be integer.  If _a_r_r_a_y has rank one, _s_h_i_f_t must be a
  34.                scalar.  Otherwise, _s_h_i_f_t must be scalar or have rank _n-1
  35.                and have
  36.                shape (_d , _d , ..., _d     , _d     , ..., _d ),
  37.                        1   2        _d_i_m-1   _d_i_m+1        _n
  38.                where (_d , _d , ..., _d )
  39.                        1   2        n
  40.                is the shape of _a_r_r_a_y.
  41.  
  42.      _b_o_u_n_d_a_r_y  Must be of the same type and have the same type parameters
  43.                as _a_r_r_a_y.  Must be scalar if _a_r_r_a_y has rank one; otherwise,
  44.                it must be either scalar or of rank _n-1 and of
  45.                shape (_d , _d , ..., _d     , _d     , ..., _d ),
  46.                        1   2        _d_i_m-1   _d_i_m+1        _n
  47.                The _b_o_u_n_d_a_r_y argument can be omitted for the data types in
  48.                the following list.  In these cases, the default value is
  49.                the scalar value shown:
  50.  
  51.                TTyyppee ooff _a_r_r_a_y       DDeeffaauulltt VVaalluuee ooff _b_o_u_n_d_a_r_y
  52.  
  53.                Integer             0
  54.  
  55.                Real                0.0
  56.  
  57.                Complex             (0.0,0.0)
  58.  
  59.                Logical             false
  60.  
  61.                Character(_l_e_n)      _l_e_n blanks
  62.  
  63.                The _b_o_u_n_d_a_r_y data type must be present for derived data
  64.                types.
  65.  
  66.      _d_i_m       Must be a scalar.  Must be an integer value in the range
  67.                1 <= _d_i_m <= _n, where _n is the rank of _a_r_r_a_y.  If _d_i_m is
  68.                omitted, the default value is 1.
  69.  
  70.      EEOOSSHHIIFFTT is a transformational intrinsic function.  The name of this
  71.      intrinsic cannot be passed as an argument.
  72.  
  73. RREETTUURRNN VVAALLUUEESS
  74.      The result is an array of the same type, type parameters, and shape as
  75.      _a_r_r_a_y.
  76.  
  77.      Element (_s , _s , ..., _s )
  78.                1   2        _n
  79.      of the result has the value
  80.      _a_r_r_a_y(_s , _s , ..., _s     , _s    + _s_h, _s     , ..., _s ),
  81.             1   2        _d_i_m-1   _d_i_m        _d_i_m+1        _n
  82.      where _s_h is _s_h_i_f_t or
  83.      _s_h_i_f_t(_s , _s , ..., _s     , _s     , ..., _s ),
  84.             1   2        _d_i_m-1   _d_i_m+1        _n
  85.      provided that the inequality
  86.      LLBBOOUUNNDD((_a_r_r_a_y,_d_i_m) <= _s    + _s_h <= UUBBOOUUNNDD((_a_r_r_a_y,_d_i_m)
  87.                            _d_i_m
  88.      holds and is otherwise _b_o_u_n_d_a_r_y or
  89.      _b_o_u_n_d_a_r_y(_s , _s , ..., _s     , _s     , ..., _s ).
  90.                1   2        _d_i_m-1   _d_i_m+1        _n
  91.  
  92. EEXXAAMMPPLLEESS
  93.      Example 1:  If VV is an array [[11,, 22,, 33,, 44,, 55,, 66]], the effect of
  94.      shifting VV end-off to the left by three positions is achieved by
  95.      EEOOSSHHIIFFTT((VV,, SSHHIIFFTT == 33)), which has the value [[44,, 55,, 66,, 00,, 00,, 00]].
  96.      Specifying EEOOSSHHIIFFTT((VV,, SSHHIIFFTT == --22,, BBOOUUNNDDAARRYY == 9999)) achieves an end-off
  97.      shift to the right by two positions with the boundary value of 9999 and
  98.      has the value of [[9999,, 9999,, 11,, 22,, 33,, 44]].
  99.  
  100.      Example 2:  The rows of an array of rank two can all be shifted by the
  101.      same amount or by different amounts and the boundary elements can be
  102.      the same or different.  Assume that MM is the following array:
  103.  
  104.           | A B C |
  105.           | D E F |
  106.           | G H I |
  107.  
  108.      The value of EEOOSSHHIIFFTT((MM,, SSHHIIFFTT ==--11,, BBOOUUNNDDAARRYY == ''**'',, DDIIMM == 22)) is as
  109.      follows:
  110.  
  111.           | * A B |
  112.           | * D E |
  113.           | * G H |
  114.  
  115.      The value of EEOOSSHHIIFFTT((MM,, SSHHIIFFTT ==((// --11,, 11,, 00 //)),, BBOOUUNNDDAARRYY == ((// ''**'',, ''//'',,
  116.      ''??'' //)),, DDIIMM == 22)) is as follows:
  117.  
  118.           | * A B |
  119.           | E F / |
  120.           | G H I |
  121.  
  122.      The value of section EEOOSSHHIIFFTT((MM((22::33,,22::33)),, SSHHIIFFTT == --11,, BBOOUUNNDDAARRYY == ''**'',,
  123.      DDIIMM==22)) is as follows:
  124.  
  125.           | * E |
  126.           | * H |
  127.  
  128. SSEEEE AALLSSOO
  129.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  130.      man page.
  131.